package com.yanfan.energybilling.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yanfan.common.annotation.Excel;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 能源扣款记录实体类
 * 对应TDengine超级表: device_energy_deduction_record
 */
@Getter
@Setter
public class TDEnergyDeductionRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 时间戳
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "时间")
    private Date ts;

    private Long tsLong;

    /**
     * 结算类型: 1-时结算，2-日结算，3-月结算，4-年结算
     */
    @Excel(name = "类型")
    private Integer type;

    /**
     * 设备ID
     */
    @Excel(name = "设备Id")
    private Long deviceId;

    /**
     * 建筑id
     */
    @Excel(name = "区域编号")
    private Long buildingId;

    /**
     * 建筑名称
     */
    @Excel(name = "区域名称")
    private String buildingName;

    /**
     * 设备名称
     */
    @Excel(name = "设备名称")
    private String deviceName;

    /**
     * 能源类型
     */
    @Excel(name = "能源类型")
    private Integer energyType;

    /**
     * 点位
     */
    @Excel(name = "点位名称")
    private String identity;

    /**
     * 单价
     */
    @Excel(name = "价格")
    private BigDecimal price;

    /**
     * 服务费单价
     */
    @Excel(name = "服务单价格")
    private BigDecimal servicePrice;

    /**
     * 上次读数
     */
    @Excel(name = "上次上报值")
    private BigDecimal lastValue;

    /**
     * 本次读数
     */
    @Excel(name = "这次上报值")
    private BigDecimal currentValue;

    /**
     * 两次读数差值
     */
    @Excel(name = "差值")
    private BigDecimal differenceValue;

    /**
     * 基础扣款金额
     */
    @Excel(name = "能源价格")
    private BigDecimal priceAmount;

    /**
     * 服务费扣款金额
     */
    @Excel(name = "服务价格")
    private BigDecimal servicePriceAmount;

    /**
     * 总扣款金额
     */
    @Excel(name = "总价格")
    private BigDecimal totalAmount;

    /**
     * 设备编号 (TAGS字段)
     */
    @Excel(name = "设备编号")
    private String deviceNumber;

}
